Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve mdox UX #49

Merged
merged 2 commits into from
Jun 28, 2021
Merged

Improve mdox UX #49

merged 2 commits into from
Jun 28, 2021

Conversation

saswatamcode
Copy link
Collaborator

This PR adds a cli spinner with description for mdox fmt command and adds colored diff for mdox fmt --check command.
This does not change CI logs and only affects output when run on a terminal.
Dependencies added: glamour, yacspin, go-isatty.

Screenshots attached below.

For mdox fmt:
Screenshot 2021-06-20 at 3 16 45 PM
Screenshot 2021-06-20 at 3 18 20 PM

For diffs:
Screenshot 2021-06-20 at 3 24 57 PM
Screenshot 2021-06-20 at 3 26 19 PM

Signed-off-by: Saswata Mukherjee <[email protected]>
@saswatamcode saswatamcode self-assigned this Jun 20, 2021
Copy link
Owner

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just style nit 🤗

Comment on lines 283 to 288
if spin != nil {
err := spin.Stop()
if err != nil {
errs.Add(err)
}
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if spin != nil {
err := spin.Stop()
if err != nil {
errs.Add(err)
}
}
if spin != nil {
errs.Add(spin.Stop())
}

Add checks error already

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure!

f := New(ctx, opts...)
b := bytes.Buffer{}
if spin != nil {
err := spin.Start()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Signed-off-by: Saswata Mukherjee <[email protected]>
@bwplotka bwplotka merged commit 1b32e8f into bwplotka:main Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants